package leetcode.二叉树;

public class 翻转二叉树226 {
    public TreeNode invertTree(TreeNode root) {
        process(root);
        return root;
    }
    private void process(TreeNode root) {
        if(root == null)
            return;
        TreeNode temp = root.right;
        root.right = root.left;
        root.left = temp;
        process(root.left);
        process(root.right);

    }
}
